<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%>
<%@page import="com.feib.soeasy.util.UserUtil"%>

<c:choose>
    <c:when test="${null != actionBean.resultPayerTemp}">
        <div id="modifyPayerViewDiv">
            <stripes:form id="payerModifyFrom" beanclass="com.feib.soeasy.action.Soez2001ActionBean" 
                method="post">        
                <table id="PayerTable">
                	<%  if (UserUtil.isBankGroup()) {%>
                    <tr>
                        <th>業者代號</th>
                        <td>
                        	<c:out value="${actionBean.resultPayerTemp.group.groupNo }" />                               
                        </td> 
                        <th>業者名稱</th>
                        <td>
                        	<c:out value="${actionBean.resultPayerTemp.group.groupName }" />                               
                        </td>                               
                    </tr>
                    <%
                        } else {
                    %>                             
                    <% }%> 
                    <tr>
                        <th>客戶編號</th>
                        <td>
                        	<c:out value="${actionBean.resultPayerTemp.payerNo }" />
                        </td> 
                        <th>姓名</th>
                        <td>
                        	<c:out value="${actionBean.resultPayerTemp.payerName }" />
                        </td>                       
                    </tr>                 
                    <tr>
                        <th>E-MAIL</th>
                        <td colspan="3">
                        	<c:out value="${actionBean.resultPayerTemp.payerEmail }" />
                        </td>                        
                    </tr>                
                    <tr>
                        <th>電話</th>
                        <td>
                        	<c:out value="${actionBean.resultPayerTemp.payerTelNo }" />
                        </td>
                        <th>手機號碼</th>
                        <td>
                        	<c:out value="${actionBean.resultPayerTemp.payerCellNo }" />
                        </td>                        
                    </tr>  
                    <tr>
                        <th>坪數</th>
                        <td>
                        	<c:out value="${actionBean.resultPayerTemp.levelGround }" />
                        </td>
                        <th>車位數</th>
                        <td>
                        	<c:out value="${actionBean.resultPayerTemp.parkingCount }" />
                        </td>                        
                    </tr>  
                    
                    <tr>
                        <th>門牌號碼</th>
                        <td colspan="3">
                        	<c:out value="${actionBean.resultPayerTemp.houseNo }" />                        
                        </td>
                    </tr>    
                    <tr>
                        <th>聯絡地址</th>
                        <td colspan="3">
                        	<c:out value="${actionBean.resultPayerTemp.payerAddress }" />                        
                        </td>
                    </tr> 
                    <tr>
                        <th>備註</th>
                        <td colspan="3">
                        	<c:out value="${actionBean.resultPayerTemp.payerMemo }" />                      
                        </td>
                           
                    </tr> 
                    <tr>
                       <th>交易紀錄狀態</th>    
                     <td align="left">
                        	<c:choose>
			                  	<c:when test="${'D' == actionBean.resultPayerTemp.recordStatus }">刪除</c:when>
			                  	<c:when test="${'U' == actionBean.resultPayerTemp.recordStatus }">修改</c:when>
			                   	<c:otherwise>新增</c:otherwise>  
			                </c:choose> 
                      </td>
                      
                    </tr>
                    
                    
                    
                                                                                                
                    <tr>
                        <td colspan="4" class="queryFunction" align="center">
                            <input type="button" id="passPayerBtn1" name="passPayerBtn1" value="放行" class="formBtn"/>
                            <input type="button" id="cancelPayerBtn1" name="cancelPayerBtn1" value="退件" class="formBtn"/>
                            <input type="button" id="doCloseBtn" name="doCloseBtn" value="離開" class="formBtn"/>
                          
                        </td>
                    </tr>                   
                </table>
            </stripes:form>    
        </div>
        <div id="deletePayerHiddenFormDiv" style="display: none; ">
            <stripes:form id="confirmPayerHiddenFrom" beanclass="com.feib.soeasy.action.Soez2001ActionBean" 
                method="post" onsubmit="javascript: return false;">                
				<input type="hidden" id="hidden4.resultPayerTemp.payerStatus" name="resultPayerTemp.payerStatus"/>
				<input type="hidden" id="hidden4.resultPayerTemp.recordStatus" name="resultPayerTemp.recordStatus"/>
                <input type="hidden" id="hidden4.resultPayerTemp.payerTempPk" name="checkPayerTemp[0].payerTempPk" value="<c:out value='${actionBean.resultPayerTemp.payerTempPk}'/>"/>                
                <input type="hidden" id="method5" name="doAjaxPayersConfirm"/>
            </stripes:form>
        </div>
        <div id="deletePayerMsgDiv" style="display: none; ">
        </div> 
        <script type="text/javascript">
        <!--
            $(document).ready(function() {
            	
            	
                
                $("#doCloseBtn").click(function() {
                    $("#payerDiv").dialog("close");
                });
                
                $("#passPayerBtn1").click(function() {
                	
                	$('#hidden4\\.resultPayerTemp\\.payerStatus').val('Y');
                	
                	$('#hidden4\\.resultPayerTemp\\.recordStatus').val("<c:out value='${actionBean.resultPayerTemp.recordStatus}'/>");
                	
                	waitingDialog({});
        			
        			$.ajax({url : "<c:url value='/ajax/Soez2001.action'/>",
        				async : true,
        				type : 'POST',
        				data : $("#confirmPayerHiddenFrom").serialize(),
        				dataType : 'html',
        				success : function(data, textStatus, XMLHttpRequest){
        						$("#ajaxErrorMessageDiv").html(data);
        					},
        				error : function(XMLHttpRequest, textStatus, errorThrown){
        					$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
        					$("#ajaxErrorMessageDiv" ).dialog({  
        						title:'系統錯誤' 
        						,width: 600
        						, resizable: false
        						, modal: true
        						, buttons: {
        							Ok: function() {
        								$( this ).dialog( "close" );
        							}
        						}
        					});
        					},
        				complete: function(XMLHttpRequest, textStatus){
        					closeWaitingDialog();
        				}
        			});
                });  
                
                $("#cancelPayerBtn1").click(function() {
                	$('#hidden4\\.resultPayerTemp\\.payerStatus').val('N');
                	waitingDialog({});
        			
        			$.ajax({url : "<c:url value='/ajax/Soez2001.action'/>",
        				async : true,
        				type : 'POST',
        				data : $("#confirmPayerHiddenFrom").serialize(),
        				dataType : 'html',
        				success : function(data, textStatus, XMLHttpRequest){
        						$("#ajaxErrorMessageDiv").html(data);
        					},
        				error : function(XMLHttpRequest, textStatus, errorThrown){
        					$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
        					$("#ajaxErrorMessageDiv" ).dialog({  
        						title:'系統錯誤' 
        						,width: 600
        						, resizable: false
        						, modal: true
        						, buttons: {
        							Ok: function() {
        								$( this ).dialog( "close" );
        							}
        						}
        					});
        					},
        				complete: function(XMLHttpRequest, textStatus){
        					closeWaitingDialog();
        				}
        			});
                });          
            });        
        
           
        //-->
        </script>        
    </c:when>
    <c:otherwise>
            查無資料
        <script type="text/javascript">
        <!--
        $(document).ready(function() {
            $( "#payerDiv" ).dialog({  title:'繳款人資料' ,width: 600, resizable: false, modal: true  });
        });
        //-->
        </script>
    </c:otherwise>
</c:choose>    